<template>
	<view class="page_1">
		<view class="hello">你好</view>
		<view class="small_title">
			<image src="@/static/safety.png"></image>
			<text>将为您加密处理信息，请放心使用</text>
		</view>
		<view class="item">
			<view class="label">
				卡号
			</view>
			<input type="text" placeholder="请绑定持卡人的金福提货券卡号" placeholder-class="input_plac">
		</view>
		<view class="item">
			<view class="label">
				姓名
			</view>
			<input type="text" placeholder="请输入姓名" placeholder-class="input_plac">
		</view>
		<view class="item">
			<view class="label">
				手机号
			</view>
			<input type="text" placeholder="请输入手机号码" placeholder-class="input_plac">
		</view>
		<view class="userAgreement">
			<view @click="isLabelActive = !isLabelActive">
				<image src="@/static/label@active.png" v-if="isLabelActive"></image>
				<image src="@/static/label.png" v-else></image>
			</view>
			<view class="text">
				<text>已阅读并同意</text>
				<text>《用户协议》</text>
			</view>
		</view>
		<view class="btn" @click="openVerifyNum">
			确定绑卡
		</view>
		<uni-popup ref="verifyNum">
			<view class="popup_box">
				<view class="title">
					<view></view>
					<view class="item_title">
						<text>请输入验证码</text>
						<view class="line"></view>
					</view>
					<view>
						<image src="@/static/gb.png" mode=""></image>
					</view>
				</view>
				<view class="small_title_phone">
					<view class="text"><text>已发送到：</text>186 7988 7766</view>
					<view class="time">
						56秒
					</view>
				</view>
				<view class="content_num">
					<view class="content_num_item " v-for="(item,index) in 4" :class="index==verifyNum.length?'active':''" >
						{{verifyNum[index]||""}}</view>
					<input type="number" class="input_num" v-model="verifyNum" :maxlength="4">
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isLabelActive: false,
				verifyNum: ""
			};
		},
		methods: {
			// 确认绑卡打开弹窗
			openVerifyNum() {
				this.$refs.verifyNum.open("center")
			},
		}
	}
</script>
<style>
	.input_plac {
		font-size: 28rpx;
		font-family: Source Han Sans CN-Medium, Source Han Sans CN;
		font-weight: 500;
		color: #BFBFBF;
		line-height: 1em;
	}
</style>
<style lang="scss" scoped>
	.page_1 {
		padding: 0 30rpx;
		box-sizing: border-box;
	}

	.hello {
		font-size: 36rpx;
		font-family: Source Han Sans CN-Medium, Source Han Sans CN;
		font-weight: 500;
		color: #222222;
		line-height: 1em;
		margin-top: 22rpx;
	}

	.small_title {
		margin-top: 24rpx;
		margin-bottom: 42rpx;
		display: flex;
		gap: 0 24rpx;

		image {
			width: 24rpx;
			height: 28rpx;
		}

		text {
			font-size: 26rpx;
			font-family: Source Han Sans CN-Regular, Source Han Sans CN;
			font-weight: 400;
			color: #555555;
			line-height: 1em;
		}
	}

	.item {
		width: 690rpx;
		height: 100rpx;
		background: #FFFFFF;
		border-radius: 16rpx;
		padding: 0 24rpx;
		box-sizing: border-box;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 24rpx;

		.label {
			font-size: 28rpx;
			font-family: Source Han Sans CN-Medium, Source Han Sans CN;
			font-weight: 500;
			color: #222222;
			line-height: 1em;
			width: 3em;
			text-align: justify;
			text-align-last: justify;
			flex-shrink: 0;

			:after {
				content: '';
				display: inline-block;
			}
		}

		input {
			width: 100%;
			height: 100%;
			text-align: end;
		}
	}

	.userAgreement {
		display: flex;
		align-items: center;
		gap: 18rpx;
		margin-top: 48rpx;

		image {
			width: 30rpx;
			height: 30rpx;
		}

		.text {
			display: flex;
			align-items: center;
			font-size: 28rpx;
			font-family: Source Han Sans CN-Regular, Source Han Sans CN;
			font-weight: 400;
			color: #888888;
			line-height: 1em;

			text:last-child {
				color: #F94D29;
			}
		}
	}

	.btn {
		width: 690rpx;
		height: 96rpx;
		background: linear-gradient(360deg, #F99529 0%, #F94D29 100%);
		border-radius: 83rpx 83rpx 83rpx 83rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 36rpx;
		font-family: Source Han Sans CN-Medium, Source Han Sans CN;
		font-weight: 500;
		color: #FFFFFF;
		margin-top: 120rpx;
	}

	.popup_box {
		width: 690rpx;
		height: 458rpx;
		background: #FFFFFF;
		border-radius: 80rpx 80rpx 80rpx 80rpx;
		display: table;
		content: "";

		.title {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 40rpx;
			padding: 0 44rpx;
			box-sizing: border-box;
			width: 100%;

			.item_title {
				font-size: 36rpx;
				font-family: Source Han Sans CN-Medium, Source Han Sans CN;
				font-weight: 500;
				color: #222222;
				position: relative;
				line-height: 1em;

				.line {
					width: 100%;
					height: 16rpx;
					background: rgba(249, 77, 41, 0.1);
					position: absolute;
					bottom: -4rpx;
				}
			}

			image {
				width: 40rpx;
				height: 40rpx;
			}
		}

		.small_title_phone {
			margin: 66rpx 0 64rpx 0;
			display: flex;
			justify-content: center;
			align-items: center;
			gap: 0 28rpx;

			.text {
				font-size: 28rpx;
				font-family: Source Han Sans CN-Regular, Source Han Sans CN;
				font-weight: 400;
				color: #555555;

				text:last-child {
					color: #222222;
				}
			}

			.time {
				padding: 8rpx 10rpx 6rpx 12rpx;
				box-sizing: border-box;
				background: rgba(249, 77, 41, 0.1);
				font-size: 24rpx;
				font-family: Source Han Sans CN-Medium, Source Han Sans CN;
				font-weight: 500;
				color: #F94D29;
				lighting-color: 1em;
				border-radius: 38rpx 38rpx 38rpx 38rpx;

			}
		}

		.content_num {
			padding: 0 144rpx;
			box-sizing: border-box;
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;
			position: relative;



			.content_num_item {
				width: 84rpx;
				height: 84rpx;
				background: #FFFFFF;
				border-radius: 24rpx 24rpx 24rpx 24rpx;
				border: 2rpx solid #E1E1E1;
				display: flex;
				justify-content: center;
				align-items: center;
			}

			.input_num {
				width: 402rpx;
				height: 100%;
				position: absolute;
				top: 0;
				left: 50%;
				transform: translateX(-50%);
				color: rgba(0, 0, 0, 0);
			}
		}
	}

	.active {
		border: 2rpx solid #F94D29 !important;
	}
</style>
